package com.lx.partitionsum;

import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;

import java.io.IOException;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: chenjiang
 * @Date: 2021/11/18/20:12
 * @Description:
 */
public class CovidPartitionReducer extends Reducer<Text, Text, Text, NullWritable> {
    /***
     * @param key
     * @param values
     * @param context
     * @throws IOException
     * @throws InterruptedException
     * @Descc: 输出Value 的类型 在Maoreduce中 如果实在是找不到数据类型的进行输出的话 直接使用NullWritable
     */
    @Override
    protected void reduce(Text key, Iterable<Text> values, Context context) throws IOException, InterruptedException {
        for (Text value : values) {
            context.write(value, NullWritable.get());
        }
    }
}
